home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <stdlib.h>
- #include <dos.h>
- #include "define.h"
-
- #ifdef DEBUG
- main()
- {
- printf("return is %d\n", cdr_pause(0));
- }
- #endif
-
- /* 音楽演奏一時停止 */
- /*
- * decice_no: device number (Towns CD-ROM -> 0)
- * return: 0 -> 正常終了, DEVPAUSE -> 既に停止中, それ以外 -> エラー
- */
- int cdr_pause(int device_no)
- {
- union REGS reg;
-
- reg.h.ah = 0x55;
- reg.h.al = (0xC0 | (u_char) device_no);
- reg.x.cx = 0x0000;
-
- int86(0x93, ®, ®);
-
- if (reg.h.ah == 0) {
- return 0;
- } else if (reg.h.ah == 0x22) { /* already stopped */
- return DEVPAUSE;
- } else if (reg.h.ah == 0x02) { /* device number error */
- return DEVERR;
- } else { /* (reg.h.ah == 0x80) hard ware error */
- return reg.x.cx;
- }
- }
-
-